package com.gxuwz.prrs.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.gxuwz.prrs.R;
import com.gxuwz.prrs.constant.Constants;
import com.gxuwz.prrs.utils.NavigationUtils;

/**
 * @author 张钧
 * 预约记录页
 */
public class AppointmentRecordDetailActivity extends AppCompatActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_appointment_record_detail);
		NavigationUtils.setRedirectBottom(this);
		NavigationUtils.setBack(R.id.back,this);
		Intent intent = getIntent();
		Bundle extras = intent.getExtras();
		TextView pianoRoomNo = findViewById(R.id.piano_roomno);
		pianoRoomNo.setText(String.valueOf(extras.getInt(Constants.PIANO_ROOM_NO)));
		TextView appointmentDate = findViewById(R.id.appointment_date_str);
		appointmentDate.setText( extras.getString(Constants.APPOINTMENT_DATE));
		TextView appointmentTime = findViewById(R.id.appointment_time_str);
		appointmentTime.setText(extras.getString(Constants.APPOINTMENT_TIME));
		TextView status = findViewById(R.id.status_str);
		status.setText(extras.getString(Constants.STATUS));
		String checkInTimeStr = extras.getString(Constants.CHECK_IN_TIME);
		if(checkInTimeStr != null){
			TextView checkInTime = findViewById(R.id.check_in_time);
			checkInTime.setText(checkInTimeStr);
		}
		String checkOutTimeStr = extras.getString(Constants.CHECK_OUT_TIME);
		if(checkOutTimeStr != null){
			TextView checkOut = findViewById(R.id.check_out);
			checkOut.setText(checkOutTimeStr);
		}
		TextView pianoAppointmentTime = findViewById(R.id.piano_appointment_time);
		pianoAppointmentTime.setText(extras.getString(Constants.PIANO_APPOINT_TIME));
	}
}
